// drms
import { entityScript as drmsMachineEntityScript } from '@/script/business/drms/machine/data'
// base
import { entityScript as templateEntityScript } from '@/script/business/template'

// 脚本组
export const scriptJson = {}

// 加载模块
// drms
drmsMachineEntityScript.init(scriptJson)

// 获取实体脚本
export function getEntityScript(model, entity) {
  if (!Object.prototype.hasOwnProperty.call(scriptJson, model)) {
    return templateEntityScript
  }
  if (!Object.prototype.hasOwnProperty.call(scriptJson[model], entity)) {
    return templateEntityScript
  }

  return scriptJson[model][entity]
}
